//  [10/18/2013 OMEGA] created

#include "DuelGUIECommon.h"
#include "Duel.h"
#include "DuelGUIEAbstractRenderWindow.h"

using namespace Duel;

DUEL_IMPLEMENT_RTTI_2(DGUIEAbstractRenderWindow, DRenderWindow, DRenderable);

DGUIEAbstractRenderWindow::DGUIEAbstractRenderWindow() :
	DRenderWindow(NULL, "__AbstractRenderWindow")
{
	resize(1024, 768);
	mRenderEffect = DResourceGroupManager::getSingleton().
		getResouceManager("RenderEffect")->
		getResource("UI_Editor.dre", "_BasicShaderPack");
	if (mRenderEffect.get() != NULL)
	{
		mRenderEffect->touch();
	}
}

DGUIEAbstractRenderWindow::~DGUIEAbstractRenderWindow()
{

}

DRenderView* DGUIEAbstractRenderWindow::getRenderView( ElementAttachment elem )
{
	return NULL;
}

void DGUIEAbstractRenderWindow::disableElement( ElementAttachment elem )
{

}

void DGUIEAbstractRenderWindow::enableElement( ElementAttachment elem )
{

}

Duel::uint32 DGUIEAbstractRenderWindow::getWindowHandle()
{
	return 0;
}

void DGUIEAbstractRenderWindow::update()
{

}

Duel::uint32 DGUIEAbstractRenderWindow::getLeft()
{
	return 0;
}

Duel::uint32 DGUIEAbstractRenderWindow::getTop()
{
	return 0;
}

void DGUIEAbstractRenderWindow::reposition( uint32 top, uint32 left )
{
	
}

bool DGUIEAbstractRenderWindow::isFullScreen() const
{
	return false;
}

void DGUIEAbstractRenderWindow::setFullScreen( bool flag, const DisplayMode& fullScreenMode )
{

}

void DGUIEAbstractRenderWindow::create( const DString& name, const RenderWindowSetting& setting, uint32 winHandle )
{

}

const DString& DGUIEAbstractRenderWindow::getName()
{
	return mName;
}

DRenderLayout* DGUIEAbstractRenderWindow::getRenderLayout()
{
	return mRenderLayout.get();
}

DRenderTechnique* DGUIEAbstractRenderWindow::getForwardRenderTechnique()
{
	if(mRenderEffect.get() != NULL)
	{
		return mRenderEffect->getAs<DRenderEffect>()->getTechnique("colored_wireframe_t0").get();
	}
	return NULL;
}

void DGUIEAbstractRenderWindow::getWorldTransform( DMatrix4& outMat )
{	
	outMat = DMatrix4::IDENTITY;
}
